package dewu;

import java.util.*;

public class kaimushi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] tall = new int[n];
        for(int i = 0; i < n; i++) {
            tall[i] = sc.nextInt();
        }
        Arrays.sort(tall);
        call(tall, n);
    }

    private static void call(int[] tall, int n) {
        int[] avgTall = new int[n];
        int index = 0;
        int maxGap = 0;
        for (int i = 0; i < n; i += 2) {
            avgTall[index++] = tall[i];
        }
        int i = n % 2 == 0 ? n-1 : n-2;
        for (; i >= 0; i -= 2) {
            avgTall[index++] = tall[i];
        }
        for (int j = 0; j < n; j++) {
            int gap = Math.abs(avgTall[j] - avgTall[(j + 1) % n]);
            maxGap = Math.max(maxGap, gap);
        }

        System.out.println(maxGap);
    }
}
